class Solution {
    public:
        int countPrefixes(vector<string>& words, string s) {
            int ans = 0;
            for(string& str : words){
                bool t = true;
                for(int i = 0;i < str.size();i++){
                    if(str[i] != s[i]){
                        t = false;
                        break;
                    }
                }
                if(t) ans++;
            }
            return ans;
        }
    };